﻿@model Project_1.Models.CreateQuestionModel
@{
    ViewBag.Title = "Create Question";
}
<h2>Create Question</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/Scripts/mdd_styles.css" />
<script type="text/javascript" src="/Scripts/jQuery-1.5.1.min.js"></script>
<script type="text/javascript" src="/Scripts/MarkdownDeepLib.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("textarea.mdd_editor").MarkdownDeep({
            help_location: "/Scripts/mdd_help.htm",
            ExtraMode: true
        });
    })
</script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Ask a Question</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Content)
        </div>
        <div class="mdd_toolbar"></div>
		@Html.TextAreaFor(model => model.Content, new { @class="mdd_editor" })
		<div class="mdd_resizer"></div>
		<div class="mdd_preview"></div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CategoryId, "Category")
        </div>
        <div>
            @Html.DropDownListFor(model => model.CategoryId, (SelectList)ViewBag.CategoryList, "Choose Category")
            @Html.ValidationMessageFor(model => model.CategoryId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Image)
        </div>
        <div class="editor-field">
            <input type="file" name="file" />
            @Html.ValidationMessageFor(model => model.Image)
        </div>
        @Html.Partial("_Captcha", new Project_1.Models.Captcha())
        @Html.Partial("_InvisibleCaptcha", new Project_1.Models.InvisibleCaptcha())
        <p>
            <input type="submit" value="Ask!" />
        </p>
    </fieldset>
}
